{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 点击上方 ▶ 运行，等待输入框出现\n",
    "from main import *\n",
    "print('输入上下联，或输入`q`退出')\n",
    "print('如有下联用`|`隔开，下联空字用空格或减号占位')\n",
    "print('输入例：\\n白日依山尽\\n白日依山尽|-河-海\\n白日依山尽|明月\\n', flush=True)\n",
    "while True:\n",
    "    try:\n",
    "        i = input(\"请输入：\").split('|')\n",
    "        first = i[0]\n",
    "        second = i[1] if len(i)>1 else ''\n",
    "        if first.startswith('q'): break\n",
    "        print_match_all(first, second)\n",
    "        print('='*8)\n",
    "    except Exception as e:\n",
    "        print(e)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# or\n",
    "from main import *\n",
    "firsts = ['天与云与山与水，上下一白',\n",
    "          '两个黄鹂鸣翠柳',\n",
    "          '无边落木萧萧下', \n",
    "          '月落乌啼霜满天', \n",
    "          '提刀上马，江山如画', \n",
    "          '兰亭临帖，行书如行云流水',\n",
    "          '荒烟漫草的年头，就连分手都很沉默',\n",
    "          '一条大河波浪宽，风吹稻花香两岸',\n",
    "          '我欲成仙，快乐齐天',\n",
    "          '只有刚强的人，才有神圣的意志，凡是战斗的人，才能取得胜利',\n",
    "          '？'\n",
    "         ]\n",
    "for f in firsts:\n",
    "    print_match_all(f)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
